// ===================================================================== Declare
const { $fn, $Lazy } = window
// ===================================================================== Lazy
const $cache = $Lazy.file(()=>import('#private/cache-api'))
// ===================================================================== 44014/44016
const width = 250
const BoolStatus = [{ name:'是', value: '1' }, { name:'否', value:'0' }]
const _ = {
	forms: [
		{ label: '条码号',			name: 'spec_code'  },
		
		{ label: '实验号 ',			name: 'experiment_num' },
		{ label: '姓名 ',			name: 'patient_name' },
		/*  查询时项目可多选 2021-09-28  --耿琰 */
		{ label: '项目',				name: 'kind_id', mode:'multiple', type: 'select', loading:true, width },
		/* 第三方条码和第三方医院查询放最后面，默认的时间查询放第一行末 2021-08-26  --耿琰 */
		{ label: '录入时间',			names: ['start_date','end_date'], name:'jz-time', type: 'date-range', loading:true, outer: true }, // 迟发、退单、终止
		{ label: '提交时间',			names: ['ts_user_start_at','ts_user_end_at'], name:'submit-time', type: 'date-range', loading:true, hide:true },
		{ label: '审核时间',			names: ['ts_audit_start_at','ts_audit_end_at'], name:'audit-time', type: 'date-range', loading:true, hide:true },
		{ label: '批准时间',			names: ['ts_approve_start_at','ts_approve_end_at'], name:'approve-time', type: 'date-range', loading:true, hide:true },
		/*  查询时自然项目可多选 2021-09-28  --耿琰 */
		{ label: '自然项目',			name: 'parent_kind_id', type: 'select',mode:'multiple', loading:true, width },
		{ label: '医院名称',			name: 'hosp_id', type: 'select', loading:true },
				
		{ label: '第三方条码号',		name: 'third_spec_code' },
		{ label: '第三方医院',		name: 'third_hosp_id', 	type: 'select', loading:true },
		/*  添加空结果搜索 2021-09-28  --耿琰 */	//是否显示空结果改为下拉搜索2022/8/3 --马婷
		{ label: '是否有结果',		name: 'result_null', 	type: 'select',	data:BoolStatus },
	],
	getSelect(forms){
		$cache.then( async f => {
			const hosp = await f.getCache({ api:'hospital' })
			// 第三方医院
			$fn.setRow( forms, 'third_hosp_id', hosp )
			// 医院名称
			$fn.setRow( forms, 'hosp_id', hosp )
			// 项目
			$fn.setRow( forms, 'kind_id', await f.getCache({ api:'project_select' }))
			// 自然项目
			$fn.setRow( forms, 'parent_kind_id', await f.getCache({ api:'nature_project' }))
			
			this.setState({ forms })
		})
	}
}

export default _